<?php

declare (strict_types=1);

namespace app\api\middleware;


use Closure;

class CheckSign
{
    public function handle($request, Closure $next)
    {
        $white_list = explode(',',getConfigs('system_config.api_interface_signature_white_list'));

        if(!empty($white_list) && in_array($request->pathinfo(), $white_list)){
            return $next($request);
        }

        \app\utils\CheckSign::check($request->param(),getConfigs('system_config.api_interface_signature_salt'));

        return $next($request);
    }
}
